package part1.api.exception.exceptiontest;

import java.io.FileOutputStream;

public class AutoCloseableDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了");
        try (FileOutputStream fos = new FileOutputStream("./a/b/fa.txt");
        ) {
            fos.write(2);
        } catch (Exception e) {
            System.out.println("抓捕了异常并解决了");
        }
        System.out.println("程序结束了");
    }
}
